
#ifndef __RT_H__
#define __RT_H__

#include <cmath>
#include <limits>
#include <memory>
#include <random>

using std::shared_ptr;
using std::make_shared;

const double infinity = std::numeric_limits<double>::infinity();
const double pi = 3.1415926535897932385;

inline double degree_to_radian(double degree) { return degree * pi / 180.0; }

inline double rand_double() {
	static std::uniform_real_distribution<double> distribution(0.0, 1.0);
	static std::mt19937 generator;
	return distribution(generator);
}

inline double rand_double(double min, double max) { return min + (max - min) * rand_double(); }

inline double clamp(double x, double min, double max) {
	if (x < min) { return min; }
	if (x > max) { return max; }
	return x;
}	

#include "ray.hh"
#include "vec3.hh"

#endif
